import React,{ lazy, Suspense } from 'react';
import {Route,Switch,Redirect} from 'react-router-dom'
import Loading from '@/component/Loading'
const Welcome = lazy(()=>import('@/views/home/welcome'))
const Userlist = lazy(()=>import('@/views/home/user/index'))
const Filmlist = lazy(()=>import('@/views/home/film/index'))
const Cinemalist = lazy(()=>import('@/views/home/cinema/index'))
const Collagelist = lazy(()=>import('@/views/home/collage/index'))
const SecondRules = () => {
    return (
        <Suspense fallback ={<Loading></Loading>}>
            <Switch>
                <Route path='/dashboard/welcome' component={Welcome}></Route>
                <Route path='/dashboard/user/index' component={Userlist}></Route>
                <Route path='/dashboard/film/index' component={Filmlist}></Route>
                <Route path='/dashboard/cinema/index' component={Cinemalist}></Route>
                <Route path='/dashboard/collage/index' component={Collagelist}></Route>
                <Redirect from='/dashboard' to='/dashboard/welcome'></Redirect>
            </Switch>
        </Suspense>
        
    );
}

export default SecondRules;
